package com.douban.app.model;

import lombok.Data;
import org.springframework.ui.Model;

import javax.jws.WebParam;
import java.util.List;


@Data
public class PlayModel {
    public String cover;
    private String url;
    public String name;
    private String source = url;
    private String artist;
    private String like;


    public PlayModel setAll(Song song, List<Singer> singers){
        PlayModel playModel = new PlayModel();
        playModel.cover=song.getCover();
        playModel.name=song.getName();
        playModel.url=song.getUrl();
        playModel.source=song.getUrl();
        for (Singer singer : singers) {
            playModel.artist=singer.getName()+" ";
        }
        return playModel;
    }
    public PlayModel setOne(Song song,Singer singer){
        PlayModel playModel = new PlayModel();
        playModel.cover=song.getCover();
        playModel.name=song.name;
        playModel.url=song.getUrl();
        playModel.source=song.getUrl();
        playModel.artist=singer.getName();
        return playModel;
    }
}
